﻿using System;
using System.Web.Services;
using Monkey.Warrenty.Biz;
using Monkey.Warrenty.EntityModel;

namespace MonkeyWarranty.Web.Services
{
    public partial class List : System.Web.UI.Page
    {
        #region Properties

        private static ServiceBiz _serviceBiz;
        private static ServiceBiz ServiceManager
        {
            get { return _serviceBiz ?? (_serviceBiz = new ServiceBiz()); }
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod(EnableSession = true)]
        public static object ServiceList(string name, int jtStartIndex, int jtPageSize, string jtSorting)
        {
            //return DemoMethods.PersonList();
            //return null;
            //var groupBo = CustomerGroupManager.GetAllCustomerGroups();

            //return groupBo;
            return ServiceManager.GetServices(name, jtStartIndex, jtPageSize, jtSorting);
        }

        [WebMethod(EnableSession = true)]
        public static object CreateService(Service record)
        {
            //return DemoMethods.CreatePerson(record);
            //return null;
            return ServiceManager.CreateServiceWs(record);
        }

        [WebMethod(EnableSession = true)]
        public static object UpdateService(Service record)
        {
            //return DemoMethods.UpdatePerson(record);
            //return null;
            return ServiceManager.UpdateServiceWs(record);
        }

        [WebMethod(EnableSession = true)]
        public static object DeleteService(int Id)
        {
            return ServiceManager.DeleteServiceWs(Id);
            //return null;
        }
    }
}